<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>我的信息</title>

    <meta name="viewport" content="width=device-width"/>
    <meta name="viewport" content="initial-scale=1.0,user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name = "format-detection" content = "telephone=no">
    
    <link type="text/css" href="css/css.css" rel="stylesheet" />

 <script type="text/javascript">  
    //iOS Web APP中点击链接跳转到Safari 浏览器新标签页的问题 devework.com  
    //stanislav.it/how-to-prevent-ios-standalone-mode-web-apps-from-opening-links-in-safari  
    if(("standalone" in window.navigator) && window.navigator.standalone){  
        var noddy, remotes = false;  
        document.addEventListener('click', function(event) {  
            noddy = event.target;
            while(noddy.nodeName !== "A" && noddy.nodeName !== "HTML") {  
                noddy = noddy.parentNode;  
            }  
            if('href' in noddy && noddy.href.indexOf('http') !== -1 && (noddy.href.indexOf(document.location.host) !== -1 || remotes))  
            {  
                event.preventDefault();  
                document.location.href = noddy.href;  
            }  
        },false);  
    }  
  </script> 
    
</head>
<body>
    <div class="header">
    <table width="100%" border="0" cellspacing="0" class="header_nav">
        <tr>
            <td width="10%" class="nav_left1"><a  href='javascript:window.history.go(-1)'><</a></td>
            <td width="80%" class="nav_title">我的中心</td>
            <td width="10%" class="nav_r"></td>
        </tr>
    </table>
    </div>
    
    <!--/*主要部分*/-->
    <div class="my">

            <table width="100%" border="0" cellspacing="0" class="my_name">
                <tr>
                    <td class="my_main_1"><a href="change.html">
                        <div><h3><ul id="nickname"></h3></div>
                        <div><ul id="telephone"></ul></div></a>
                    </td>
                    <td class="my_mainn"><div><ul class="slides"></ul></div></td>
                </tr>
            </table>
<!--            <table width="100%" border="0" cellspacing="0" class="my_2">
                <tr>
                    <td width="30" class="my_3"><a href="pingjia.html"><img src="img/pj.jpg" width="30%" height="auto"/><p>我的记录</p></a></td>
                    <td width="30" class="my_4"><a href="myjf.html"><img src="img/xh.jpg" width="30%" height="auto"/><p>我的积分</p></a></td>
                    <td width="30" class="my_4"><a href="myjk.html"><img src="img/jk.jpg" width="30%" height="auto"/><p>我的地址</p></a></td>
                </tr>
            </table>
-->            
            <table width="100%" border="0" cellspacing="0" class="my_n">
                <tr>
                    <td class="my_main"><a href="order.html">我的订单</a></td>
                    <td class="my_mainn"><a href="order.html"></a></td>
                </tr>               
		<tr>
                    <td class="my_main_p"><a href="shopcard.html">我的购物车</a></td>
                    <td class="my_mainn_p"><a href="shopcard.html"></a></td>
                </tr>
             </table> 
             <table width="100%" border="0" cellspacing="0" class="my_n">   
                <tr>
                    <td class="my_main_p"><a href="changepassword.html">修改密码</a></td>
                    <td class="my_mainn_p"><a href="changepassword.html"></a></td>
                </tr>
                <tr>
                    <td class="my_main_p"><a href="aboutus.html">关于我们</a></td>
                    <td class="my_mainn_p"><a href="aboutus.html"></a></td>
                </tr>
            </table>
        </div>
        <div class="button1"><a href="login.html"><input type="submit" value="退出当前账号" onclick="javascript:tuichu()" class="text2" /></a></div>

<!--网页底部栏-->
<div>
    <table width="100%" border="0" cellspacing="0" class="nav">
        <tr>
            <td width="25" class="foot"><a href="index.html"><img src="img/function.png" width="20%" height="auto"/><p>分类</p></a></td>
            <td width="25" class="foot"><a href="addgoods.html"><img src="img/addgoods.png" width="20%" height="auto"/><p>发布</p></a></td> 
            <td width="25" class="foot"><a href="shopcard.html"><img src="img/shopcard.png" width="20%" height="auto"/><p>购物车</p></a></td>
            <td width="25" class="foot"><a href="member.html"><img src="img/myself.png" width="20%" height="auto"/><p>我的</p></a></td>
        </tr>
    </table>
</div>
	<script src="js/jquery.min.js"></script>
	<script src="js/app.js"></script>
</body>
<script type="text/javascript">
	window.onload=function(){
      	$.ajax({
            url: "http://libkindle.com:8080/WebSell/LoginServlet",
            type: 'GET',
            dataType: 'json',
            data: {
				action:"get"
            },
            success: function(data,status,xhr) {
			if(data.code==0){			
					
					
           			$("#nickname").append(data.nickname)
					$("#telephone").append(data.telephone)
					$(".slides").append("<li><img src='"+data.icon+"' width='50px' height='50px' /></li>")
					$("#nickname").html(data.nickname);
					$("#telephone").html(data.telephone);
					console.log("获取信息成功");
			}else
			{	
				alert("请先登陆");
				location.href = "login.html";
			}
            },
            error: function() {
            	alert("获取信息失败");
            	window.location.href = "#";
            },
        });
    };
	
	
	
	
	
	
	function tuichu(){
      	$.ajax({
            url: "http://libkindle.com:8080/WebSell/LoginServlet",
            type: 'GET',
            dataType: 'json',
            data: {
				action:"logout"
			},
            success: function(data,status,xhr) { 
				if(data.code==0){
				console.log(data.msg);
				location.href = "index.html";
				}
 				else{
           			console.log(data.msg);
           		}           		
            },
            error: function() {
            	window.location.href = "#";
            },
        });
    };
	
	
	
	
</script>

</html>